CREATE TABLE [dbo].[Institute]
(
[ContactKey] [uniqueidentifier] NOT NULL,
[InstituteName] [nvarchar] (80) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[PrimaryContactKey] [uniqueidentifier] NULL,
[InstituteGroupKey] [uniqueidentifier] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Institute] ADD CONSTRAINT [PK_Institute] PRIMARY KEY CLUSTERED ([ContactKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [AK_Institute_InstituteGroupKey] ON [dbo].[Institute] ([InstituteGroupKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_Institute_InstituteName] ON [dbo].[Institute] ([InstituteName]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Institute] ADD CONSTRAINT [FK_Institute_ContactMain] FOREIGN KEY ([ContactKey]) REFERENCES [dbo].[ContactMain] ([ContactKey])
GO
ALTER TABLE [dbo].[Institute] ADD CONSTRAINT [FK_Institute_GroupMain_Institute] FOREIGN KEY ([InstituteGroupKey]) REFERENCES [dbo].[GroupMain] ([GroupKey])
GO